<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增车辆')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-car-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车牌号：</label>
                <div class="col-sm-8">
                    <input name="carLisenseNum" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车辆型号：</label>
                <div class="col-sm-8">
                    <input name="carModel" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车辆颜色：</label>
                <div class="col-sm-8">
                    <input name="carColor" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车辆状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_car_status')}" th:if="${dict.dictValue} ne 1 and ${dict.dictValue} ne 3">
                        <input type="radio" th:id="${'carStatus_' + dict.dictCode}" name="carStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                        <label th:for="${'carStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">车辆价格：</label>
                <div class="col-sm-8">
                    <input name="carPrice" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "lease/car"
        $("#form-car-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-car-add').serialize());
            }
        }
    </script>
</body>
</html>